using System;
using System.Collections.Generic;
using System.Text;
using Rapier.Kodachi.Shared;
using Rapier.Kodachi.WinForm;
using System.Windows.Forms;

namespace Rapier.Kodachi.Actions
{
    public class Quit : Action
    {
        public Quit()
            : base(null, "Internal", "Quit", "Quit Kodachi")
        {
            GetImage = delegate() { return System.Drawing.SystemIcons.Error.ToBitmap(); };
        }

        public override bool IsValidDirect(Item directItem)
        {
            return directItem.Properties.ContainsKey("Kodachi") && directItem.Properties["Kodachi"].Equals(true);
        }

        public override void Execute(Item[] directItems, Item[] indirectItems)
        {
            WindowMain.controller.Shutdown();
            Application.Exit();
        }
    }
}
